package com.mike.util;

import com.mike.model.ResponseResult;

public class RestResultGenerator {

    public static <T> ResponseResult<T> genResult(T data, String message){
        ResponseResult<T> result = new ResponseResult<T>();
        result.setData(data);
        if(data instanceof Boolean) {
            result.setSuccess((Boolean) data);
        }else {
            result.setSuccess(true);
        }
        result.setMessage(message);
        return result;
    }
}